Non-volatile memory or non-volatile storage (NVS) is useful in computing systems to store data which needs to be retained for a long period of time, and retain data integrity after a power loss or other system failure event. Examples of non-volatile storage may be magnetic disks, magnetic tape, optical disks, and flash memory. Such memory is also called persistent storage.
Flash memory is an example of NVS that stores information in an array of semiconductor memory cells. In a single-level cell (SLC) device, each cell stores only one bit of information. A recently developed type of flash memory, known as a multi-level cell (MLC) device, can store more than one bit per cell by choosing between multiple levels of electrical charge to apply to the cell. Other types of NVS are being developed, and may be expected to come into use in the future.
Two generic types of flash memory circuits are currently in wide use: NOR and NAND. At present, for large memory systems, NAND flash memory is preferred. While NOR flash memory permits reading and writing (programming) operations to be performed on a byte basis, and erasing on a region known as a “block”, NAND flash is organized on a block basis, analogous to a magnetic disk drive. As such, the terms sector, page, and block may be used by analogy on a hierarchical basis. The size of each of these data storage regions may vary depending on the actual product being discussed; however, the term block, when used in relation to the physical memory denotes the smallest contiguous range of physical memory locations that can be erased. Erasing a block sets all of the bits in the block to “1”. Writing, sometimes called programming, sets selected bits of a sector or a page of the block to “0” so as to result in the writing of information (data) to the memory. Sector or page programming operations within a block are performed sequentially. Such programming operations can be performed only once for each sector of NAND memory, and an entire block of the memory containing the sector must be erased prior to again writing the sector.
Since, modifying the data stored in NVS for a logical memory address would require another write to the physical memory location, which cannot be performed immediately in flash systems, the usual approach taken is to relocate the logical memory location in the physical memory so as to write the modified data to an unused, but previously-erased sector. The sector from which the data has been relocated now contains out-of-date data, and is no longer of interest to the user. As such it may be considered a “dead or invalid” sector, while the data which is current is considered to be stored in “live or valid” sectors. Sectors that are available for the writing of data may be called “free” sectors. The same terminology may be applied to describing pages, blocks, or the like.
Metadata may include data about the data stored in the system. The metadata may be, for example, the association of a logical data element to a physical storage location. It may further include information on the type of data, the time of writing of the data, error correcting codes, and other information, depending on the requirements of a file management system, thin provisioning system, distributed RAID management, disk emulation or other user needs.
When an interruption in system operation occurs due to, for example, a power failure, a hardware failure, or a software-related error, the metadata stored in volatile memory may be corrupted or lost, and the location of user data and other information, including housekeeping or status information, in the non-volatile storage (NVS) may no longer be known as of the time of the interruption.